from selenium import webdriver
from time import sleep
from selenium.webdriver.common.keys import Keys


try:
    driver = webdriver.Chrome()
    driver.get('https://www.baidu.com')

    driver.find_element_by_id('kw').send_keys('你好')
    sleep(1)
    driver.find_element_by_id('kw').send_keys(Keys.CONTROL,'A')
    sleep(1)
    driver.find_element_by_id('kw').send_keys(Keys.CONTROL,'C')
    sleep(1)
    driver.find_element_by_id('kw').send_keys(Keys.CONTROL,'V')
    sleep(1)
    driver.find_element_by_id('kw').send_keys(Keys.CONTROL,'V')
    sleep(1)
    driver.find_element_by_id('kw').send_keys(Keys.ENTER)

except Exception as e:
    print(e)
finally:
    sleep(2)
    driver.quit()